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 11
12 using blink::WebString; 12 using blink::WebString;
13 using blink::WebURL; 13 using blink::WebURL;
14 14
15 namespace content { 15 namespace content {
16 16
17 void RendererWebCookieJarImpl::setCookie( 17 void RendererWebCookieJarImpl::setCookie(
18 const WebURL& url, const WebURL& first_party_for_cookies, 18 const WebURL& url, const WebURL& first_party_for_cookies,
19 const WebString& value) { 19 const WebString& value) {
20 std::string value_utf8 = base::UTF16ToUTF8(base::StringPiece16(value)); 20 std::string value_utf8 = base::UTF16ToUTF8(base::StringPiece16(value));
21 sender_->Send(new FrameHostMsg_SetCookie( 21 sender_->render_frame_message_filter()->SetCookie(
22 sender_->GetRoutingID(), url, first_party_for_cookies, value_utf8)); 22 sender_->GetRoutingID(), url, first_party_for_cookies, value_utf8);
23 } 23 }
24 24
25 WebString RendererWebCookieJarImpl::cookies( 25 WebString RendererWebCookieJarImpl::cookies(
26 const WebURL& url, const WebURL& first_party_for_cookies) { 26 const WebURL& url, const WebURL& first_party_for_cookies) {
27 std::string value_utf8; 27 std::string value_utf8;
28 sender_->Send(new FrameHostMsg_GetCookies( 28 sender_->Send(new FrameHostMsg_GetCookies(
29 sender_->GetRoutingID(), url, first_party_for_cookies, &value_utf8)); 29 sender_->GetRoutingID(), url, first_party_for_cookies, &value_utf8));
30 return WebString::fromUTF8(value_utf8); 30 return WebString::fromUTF8(value_utf8);
31 } 31 }
32 32
33 bool RendererWebCookieJarImpl::cookiesEnabled( 33 bool RendererWebCookieJarImpl::cookiesEnabled(
34 const WebURL& url, const WebURL& first_party_for_cookies) { 34 const WebURL& url, const WebURL& first_party_for_cookies) {
35 bool cookies_enabled = false; 35 bool cookies_enabled = false;
36 sender_->Send(new FrameHostMsg_CookiesEnabled( 36 sender_->Send(new FrameHostMsg_CookiesEnabled(
37 sender_->GetRoutingID(), url, first_party_for_cookies, &cookies_enabled)); 37 sender_->GetRoutingID(), url, first_party_for_cookies, &cookies_enabled));
38 return cookies_enabled; 38 return cookies_enabled;
39 } 39 }
40 40
41 } // namespace content 41 } // namespace content
OLDNEW
« content/renderer/render_frame_impl.cc ('K') | « content/renderer/render_frame_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698