Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: extensions/browser/extension_function.cc

Issue 253013002: Pass RenderFrameHost to WebContentObservers' message handlers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typo in RenderHostTracker Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/browser/extension_function.h" 5 #include "extensions/browser/extension_function.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/public/browser/notification_source.h" 8 #include "content/public/browser/notification_source.h"
9 #include "content/public/browser/notification_types.h" 9 #include "content/public/browser/notification_types.h"
10 #include "content/public/browser/render_frame_host.h" 10 #include "content/public/browser/render_frame_host.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 function_->SetRenderViewHost(NULL); 120 function_->SetRenderViewHost(NULL);
121 } 121 }
122 virtual void RenderFrameDeleted( 122 virtual void RenderFrameDeleted(
123 content::RenderFrameHost* render_frame_host) OVERRIDE { 123 content::RenderFrameHost* render_frame_host) OVERRIDE {
124 if (render_frame_host != function_->render_frame_host()) 124 if (render_frame_host != function_->render_frame_host())
125 return; 125 return;
126 126
127 function_->SetRenderFrameHost(NULL); 127 function_->SetRenderFrameHost(NULL);
128 } 128 }
129 129
130 virtual bool OnMessageReceived(const IPC::Message& message,
131 RenderFrameHost* render_frame_host) OVERRIDE {
132 DCHECK(render_frame_host);
133 if (render_frame_host == function_->render_frame_host())
134 return function_->OnMessageReceived(message);
135 else
136 return false;
137 }
138
130 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { 139 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE {
131 return function_->OnMessageReceived(message); 140 return function_->OnMessageReceived(message);
132 } 141 }
133 142
134 UIThreadExtensionFunction* function_; 143 UIThreadExtensionFunction* function_;
135 144
136 DISALLOW_COPY_AND_ASSIGN(RenderHostTracker); 145 DISALLOW_COPY_AND_ASSIGN(RenderHostTracker);
137 }; 146 };
138 147
139 ExtensionFunction::ExtensionFunction() 148 ExtensionFunction::ExtensionFunction()
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() { 392 SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() {
384 } 393 }
385 394
386 SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() { 395 SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() {
387 } 396 }
388 397
389 bool SyncIOThreadExtensionFunction::RunImpl() { 398 bool SyncIOThreadExtensionFunction::RunImpl() {
390 SendResponse(RunSync()); 399 SendResponse(RunSync());
391 return true; 400 return true;
392 } 401 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698