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

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: Fixed Android tests 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
« no previous file with comments | « content/public/browser/web_contents_observer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 function_->SetRenderViewHost(NULL); 123 function_->SetRenderViewHost(NULL);
124 } 124 }
125 virtual void RenderFrameDeleted( 125 virtual void RenderFrameDeleted(
126 content::RenderFrameHost* render_frame_host) OVERRIDE { 126 content::RenderFrameHost* render_frame_host) OVERRIDE {
127 if (render_frame_host != function_->render_frame_host()) 127 if (render_frame_host != function_->render_frame_host())
128 return; 128 return;
129 129
130 function_->SetRenderFrameHost(NULL); 130 function_->SetRenderFrameHost(NULL);
131 } 131 }
132 132
133 virtual bool OnMessageReceived(
134 const IPC::Message& message,
135 content::RenderFrameHost* render_frame_host) OVERRIDE {
136 DCHECK(render_frame_host);
137 if (render_frame_host == function_->render_frame_host())
138 return function_->OnMessageReceived(message);
139 else
140 return false;
141 }
142
133 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { 143 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE {
134 return function_->OnMessageReceived(message); 144 return function_->OnMessageReceived(message);
135 } 145 }
136 146
137 UIThreadExtensionFunction* function_; 147 UIThreadExtensionFunction* function_;
138 148
139 DISALLOW_COPY_AND_ASSIGN(RenderHostTracker); 149 DISALLOW_COPY_AND_ASSIGN(RenderHostTracker);
140 }; 150 };
141 151
142 ExtensionFunction::ExtensionFunction() 152 ExtensionFunction::ExtensionFunction()
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() { 388 SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() {
379 } 389 }
380 390
381 SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() { 391 SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() {
382 } 392 }
383 393
384 ExtensionFunction::ResponseAction SyncIOThreadExtensionFunction::Run() { 394 ExtensionFunction::ResponseAction SyncIOThreadExtensionFunction::Run() {
385 return RespondNow(RunSync() ? MultipleArguments(results_.get()) 395 return RespondNow(RunSync() ? MultipleArguments(results_.get())
386 : Error(error_)); 396 : Error(error_));
387 } 397 }
OLDNEW
« no previous file with comments | « content/public/browser/web_contents_observer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698