Skip to content

Commit

Permalink
refactor: style and comments fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
ppontes committed Dec 1, 2018
1 parent b1e37eb commit bcc76d2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
18 changes: 12 additions & 6 deletions atom/browser/api/atom_api_web_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -783,18 +783,24 @@ void WebContents::RenderViewCreated(content::RenderViewHost* render_view_host) {

void WebContents::RenderViewHostChanged(content::RenderViewHost* old_host,
content::RenderViewHost* new_host) {
currently_committed_process_id = new_host->GetProcess()->GetID();
currently_committed_process_id_ = new_host->GetProcess()->GetID();
}

void WebContents::RenderViewDeleted(content::RenderViewHost* render_view_host) {
// This event is necessary for tracking any states with respect to
// intermediate render view hosts aka speculative render view hosts. Currently
// used by object-registry.js to ref count remote objects.
Emit("render-view-deleted", render_view_host->GetProcess()->GetID());

// When the RVH that has been deleted is the current RVH it means that the
// the embedder is closing the window.
if (-1 == currently_committed_process_id ||
if (-1 == currently_committed_process_id_ ||
render_view_host->GetProcess()->GetID() ==
currently_committed_process_id) {
currently_committed_process_id = -1;
currently_committed_process_id_) {
currently_committed_process_id_ = -1;

// When the RVH that has been deleted is the current RVH it means that the
// the web contents are being closed. This is communicated by this event.
// Currently tracked by guest-window-manager.js to destroy the
// BrowserWindow.
Emit("current-render-view-deleted",
render_view_host->GetProcess()->GetID());
}
Expand Down
2 changes: 1 addition & 1 deletion atom/browser/api/atom_api_web_contents.h
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ class WebContents : public mate::TrackableObject<WebContents>,

// The ID of the process of the currently committed RenderViewHost.
// -1 means no speculative RVH has been committed yet.
int currently_committed_process_id = -1;
int currently_committed_process_id_ = -1;

DISALLOW_COPY_AND_ASSIGN(WebContents);
};
Expand Down
8 changes: 4 additions & 4 deletions atom/browser/atom_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -238,18 +238,18 @@ bool AtomBrowserClient::NavigationWasRedirectedCrossSite(
content::SiteInstance* speculative_instance,
const GURL& dest_url,
bool has_response_started) const {
bool navigationWasRedirected = false;
bool navigation_was_redirected = false;
if (has_response_started) {
navigationWasRedirected = !IsSameWebSite(
navigation_was_redirected = !IsSameWebSite(
browser_context, current_instance->GetSiteURL(), dest_url);
} else {
navigationWasRedirected =
navigation_was_redirected =
speculative_instance &&
!IsSameWebSite(browser_context, speculative_instance->GetSiteURL(),
dest_url);
}

return navigationWasRedirected;
return navigation_was_redirected;
}

void AtomBrowserClient::AddProcessPreferences(
Expand Down

0 comments on commit bcc76d2

Please sign in to comment.