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

Unified Diff: mojo/services/network/cookie_store_impl.cc

Issue 1873463003: Remove mojo network service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/services/network/cookie_store_impl.h ('k') | mojo/services/network/http_connection_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/network/cookie_store_impl.cc
diff --git a/mojo/services/network/cookie_store_impl.cc b/mojo/services/network/cookie_store_impl.cc
deleted file mode 100644
index ebd0c928bb6676a0b5bfb2ba03a8a7c99d7b3a8d..0000000000000000000000000000000000000000
--- a/mojo/services/network/cookie_store_impl.cc
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "mojo/services/network/cookie_store_impl.h"
-
-#include <utility>
-
-#include "mojo/common/url_type_converters.h"
-#include "mojo/services/network/network_context.h"
-#include "net/cookies/cookie_store.h"
-#include "net/url_request/url_request_context.h"
-
-namespace mojo {
-namespace {
-
-void AdaptGetCookiesCallback(const Callback<void(String)>& callback,
- const std::string& cookies) {
- callback.Run(cookies);
-}
-
-void AdaptSetCookieCallback(const Callback<void(bool)>& callback,
- bool success) {
- callback.Run(success);
-}
-
-} // namespace
-
-CookieStoreImpl::CookieStoreImpl(NetworkContext* context,
- const GURL& origin,
- scoped_ptr<mojo::MessageLoopRef> app_refcount,
- InterfaceRequest<CookieStore> request)
- : context_(context),
- origin_(origin),
- app_refcount_(std::move(app_refcount)),
- binding_(this, std::move(request)) {}
-
-CookieStoreImpl::~CookieStoreImpl() {
-}
-
-void CookieStoreImpl::Get(const String& url,
- const Callback<void(String)>& callback) {
- // TODO(darin): Perform origin restriction.
- net::CookieStore* store = context_->url_request_context()->cookie_store();
- if (!store) {
- callback.Run(String());
- return;
- }
- store->GetCookiesWithOptionsAsync(
- url.To<GURL>(),
- net::CookieOptions(),
- base::Bind(&AdaptGetCookiesCallback, callback));
-}
-
-void CookieStoreImpl::Set(const String& url,
- const String& cookie,
- const Callback<void(bool)>& callback) {
- // TODO(darin): Perform origin restriction.
- net::CookieStore* store = context_->url_request_context()->cookie_store();
- if (!store) {
- callback.Run(false);
- return;
- }
- store->SetCookieWithOptionsAsync(
- url.To<GURL>(),
- cookie,
- net::CookieOptions(),
- base::Bind(&AdaptSetCookieCallback, callback));
-}
-
-} // namespace mojo
« no previous file with comments | « mojo/services/network/cookie_store_impl.h ('k') | mojo/services/network/http_connection_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698