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

Side by Side Diff: content/renderer/renderer_webcookiejar_impl.cc

Issue 2167513003: Moves FrameHostMsg_SetCookie to a Mojo message (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@browser-associated-interface
Patch Set: . Created 4 years, 4 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "content/renderer/renderer_webcookiejar_impl.h" 5 #include "content/renderer/renderer_webcookiejar_impl.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "content/common/frame_messages.h" 8 #include "content/common/frame_messages.h"
9 #include "content/public/renderer/content_renderer_client.h" 9 #include "content/public/renderer/content_renderer_client.h"
10 #include "content/renderer/render_frame_impl.h" 10 #include "content/renderer/render_frame_impl.h"
11 #include "content/renderer/render_thread_impl.h"
11 12
12 using blink::WebString; 13 using blink::WebString;
13 using blink::WebURL; 14 using blink::WebURL;
14 15
15 namespace content { 16 namespace content {
16 17
17 void RendererWebCookieJarImpl::setCookie( 18 void RendererWebCookieJarImpl::setCookie(
18 const WebURL& url, const WebURL& first_party_for_cookies, 19 const WebURL& url, const WebURL& first_party_for_cookies,
19 const WebString& value) { 20 const WebString& value) {
20 std::string value_utf8 = base::UTF16ToUTF8(base::StringPiece16(value)); 21 std::string value_utf8 = base::UTF16ToUTF8(base::StringPiece16(value));
21 sender_->Send(new FrameHostMsg_SetCookie( 22 RenderThreadImpl::current()->render_frame_message_filter()->SetCookie(
22 sender_->GetRoutingID(), url, first_party_for_cookies, value_utf8)); 23 sender_->GetRoutingID(), url, first_party_for_cookies, value_utf8);
23 } 24 }
24 25
25 WebString RendererWebCookieJarImpl::cookies( 26 WebString RendererWebCookieJarImpl::cookies(
26 const WebURL& url, const WebURL& first_party_for_cookies) { 27 const WebURL& url, const WebURL& first_party_for_cookies) {
27 std::string value_utf8; 28 std::string value_utf8;
28 sender_->Send(new FrameHostMsg_GetCookies( 29 sender_->Send(new FrameHostMsg_GetCookies(
29 sender_->GetRoutingID(), url, first_party_for_cookies, &value_utf8)); 30 sender_->GetRoutingID(), url, first_party_for_cookies, &value_utf8));
30 return WebString::fromUTF8(value_utf8); 31 return WebString::fromUTF8(value_utf8);
31 } 32 }
32 33
33 bool RendererWebCookieJarImpl::cookiesEnabled( 34 bool RendererWebCookieJarImpl::cookiesEnabled(
34 const WebURL& url, const WebURL& first_party_for_cookies) { 35 const WebURL& url, const WebURL& first_party_for_cookies) {
35 bool cookies_enabled = false; 36 bool cookies_enabled = false;
36 sender_->Send(new FrameHostMsg_CookiesEnabled( 37 sender_->Send(new FrameHostMsg_CookiesEnabled(
37 sender_->GetRoutingID(), url, first_party_for_cookies, &cookies_enabled)); 38 sender_->GetRoutingID(), url, first_party_for_cookies, &cookies_enabled));
38 return cookies_enabled; 39 return cookies_enabled;
39 } 40 }
40 41
41 } // namespace content 42 } // namespace content
OLDNEW
« content/common/render_frame_message_filter.mojom ('K') | « content/renderer/render_thread_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698