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

Side by Side Diff: chrome/renderer/extensions/extension_request_sender.cc

Issue 10024055: Remove unneeded extension_messages_browsertest.cc + cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/renderer/extensions/extension_request_sender.h" 5 #include "chrome/renderer/extensions/extension_request_sender.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "chrome/common/extensions/extension_messages.h" 8 #include "chrome/common/extensions/extension_messages.h"
9 #include "chrome/renderer/extensions/chrome_v8_context.h" 9 #include "chrome/renderer/extensions/chrome_v8_context.h"
10 #include "chrome/renderer/extensions/chrome_v8_context_set.h" 10 #include "chrome/renderer/extensions/chrome_v8_context_set.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 WebKit::WebFrame* webframe = current_context->web_frame(); 90 WebKit::WebFrame* webframe = current_context->web_frame();
91 if (webframe) { 91 if (webframe) {
92 source_url = webframe->document().url(); 92 source_url = webframe->document().url();
93 source_origin = webframe->document().securityOrigin(); 93 source_origin = webframe->document().securityOrigin();
94 } 94 }
95 95
96 v8::Persistent<v8::Context> v8_context = 96 v8::Persistent<v8::Context> v8_context =
97 v8::Persistent<v8::Context>::New(v8::Context::GetCurrent()); 97 v8::Persistent<v8::Context>::New(v8::Context::GetCurrent());
98 DCHECK(!v8_context.IsEmpty()); 98 DCHECK(!v8_context.IsEmpty());
99 InsertRequest(request_id, new PendingRequest( 99 InsertRequest(request_id, new PendingRequest(
100 v8_context, name, current_context->extension_id())); 100 v8_context, name, current_context->GetExtensionID()));
101 101
102 ExtensionHostMsg_Request_Params params; 102 ExtensionHostMsg_Request_Params params;
103 params.name = name; 103 params.name = name;
104 params.arguments.Swap(value_args); 104 params.arguments.Swap(value_args);
105 params.extension_id = current_context->extension_id(); 105 params.extension_id = current_context->GetExtensionID();
106 params.source_url = source_url; 106 params.source_url = source_url;
107 params.source_origin = source_origin.toString(); 107 params.source_origin = source_origin.toString();
108 params.request_id = request_id; 108 params.request_id = request_id;
109 params.has_callback = has_callback; 109 params.has_callback = has_callback;
110 params.user_gesture = 110 params.user_gesture =
111 webframe ? webframe->isProcessingUserGesture() : false; 111 webframe ? webframe->isProcessingUserGesture() : false;
112 if (for_io_thread) { 112 if (for_io_thread) {
113 renderview->Send(new ExtensionHostMsg_RequestForIOThread( 113 renderview->Send(new ExtensionHostMsg_RequestForIOThread(
114 renderview->GetRoutingID(), params)); 114 renderview->GetRoutingID(), params));
115 } else { 115 } else {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 &retval)); 150 &retval));
151 // In debug, the js will validate the callback parameters and return a 151 // In debug, the js will validate the callback parameters and return a
152 // string if a validation error has occured. 152 // string if a validation error has occured.
153 #ifndef NDEBUG 153 #ifndef NDEBUG
154 if (!retval.IsEmpty() && !retval->IsUndefined()) { 154 if (!retval.IsEmpty() && !retval->IsUndefined()) {
155 std::string error = *v8::String::AsciiValue(retval); 155 std::string error = *v8::String::AsciiValue(retval);
156 DCHECK(false) << error; 156 DCHECK(false) << error;
157 } 157 }
158 #endif 158 #endif
159 } 159 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698