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

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

Issue 2202723005: Move FrameHostMsg_GetCookies to mojom (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sync-associated-message
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 #include "content/renderer/render_thread_impl.h"
12 12
13 using blink::WebString; 13 using blink::WebString;
14 using blink::WebURL; 14 using blink::WebURL;
15 15
16 namespace content { 16 namespace content {
17 17
18 void RendererWebCookieJarImpl::setCookie( 18 void RendererWebCookieJarImpl::setCookie(
19 const WebURL& url, const WebURL& first_party_for_cookies, 19 const WebURL& url, const WebURL& first_party_for_cookies,
20 const WebString& value) { 20 const WebString& value) {
21 std::string value_utf8 = base::UTF16ToUTF8(base::StringPiece16(value)); 21 std::string value_utf8 = base::UTF16ToUTF8(base::StringPiece16(value));
22 RenderThreadImpl::current()->render_frame_message_filter()->SetCookie( 22 RenderThreadImpl::current()->render_frame_message_filter()->SetCookie(
23 sender_->GetRoutingID(), url, first_party_for_cookies, value_utf8); 23 sender_->GetRoutingID(), url, first_party_for_cookies, value_utf8);
24 } 24 }
25 25
26 WebString RendererWebCookieJarImpl::cookies( 26 WebString RendererWebCookieJarImpl::cookies(
27 const WebURL& url, const WebURL& first_party_for_cookies) { 27 const WebURL& url, const WebURL& first_party_for_cookies) {
28 std::string value_utf8; 28 mojo::String value_utf8;
29 sender_->Send(new FrameHostMsg_GetCookies( 29 RenderThreadImpl::current()->render_frame_message_filter()->GetCookies(
30 sender_->GetRoutingID(), url, first_party_for_cookies, &value_utf8)); 30 sender_->GetRoutingID(), url, first_party_for_cookies, &value_utf8);
31 return WebString::fromUTF8(value_utf8); 31 return WebString::fromUTF8(value_utf8);
32 } 32 }
33 33
34 bool RendererWebCookieJarImpl::cookiesEnabled( 34 bool RendererWebCookieJarImpl::cookiesEnabled(
35 const WebURL& url, const WebURL& first_party_for_cookies) { 35 const WebURL& url, const WebURL& first_party_for_cookies) {
36 bool cookies_enabled = false; 36 bool cookies_enabled = false;
37 sender_->Send(new FrameHostMsg_CookiesEnabled( 37 sender_->Send(new FrameHostMsg_CookiesEnabled(
38 sender_->GetRoutingID(), url, first_party_for_cookies, &cookies_enabled)); 38 sender_->GetRoutingID(), url, first_party_for_cookies, &cookies_enabled));
39 return cookies_enabled; 39 return cookies_enabled;
40 } 40 }
41 41
42 } // namespace content 42 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698