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

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

Issue 1413543005: Use FrameTreeNode ID as frameId in extension APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Vend frameIds at 1 location; minimize thread hops for webRequest Created 5 years 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
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/tabs_custom_bindings.h" 5 #include "chrome/renderer/extensions/tabs_custom_bindings.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "content/public/renderer/render_frame.h" 10 #include "content/public/renderer/render_frame.h"
(...skipping 29 matching lines...) Expand all
40 args[2]->IsString() && 40 args[2]->IsString() &&
41 args[3]->IsString()); 41 args[3]->IsString());
42 42
43 ExtensionMsg_TabTargetConnectionInfo info; 43 ExtensionMsg_TabTargetConnectionInfo info;
44 info.tab_id = args[0]->Int32Value(); 44 info.tab_id = args[0]->Int32Value();
45 info.frame_id = args[1]->Int32Value(); 45 info.frame_id = args[1]->Int32Value();
46 std::string extension_id = *v8::String::Utf8Value(args[2]); 46 std::string extension_id = *v8::String::Utf8Value(args[2]);
47 std::string channel_name = *v8::String::Utf8Value(args[3]); 47 std::string channel_name = *v8::String::Utf8Value(args[3]);
48 int port_id = -1; 48 int port_id = -1;
49 render_frame->Send(new ExtensionHostMsg_OpenChannelToTab( 49 render_frame->Send(new ExtensionHostMsg_OpenChannelToTab(
50 info, extension_id, channel_name, &port_id)); 50 render_frame->GetRoutingID(), info, extension_id, channel_name,
51 &port_id));
51 args.GetReturnValue().Set(static_cast<int32_t>(port_id)); 52 args.GetReturnValue().Set(static_cast<int32_t>(port_id));
52 } 53 }
53 54
54 } // namespace extensions 55 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698