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

Unified Diff: go/src/infra/gae/libs/wrapper/memory/globalinfo.go

Issue 1240573002: Reland: Refactor current GAE abstraction library to be free of the SDK* (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: expand coverage range to fit 32bit test expectations Created 5 years, 5 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
Index: go/src/infra/gae/libs/wrapper/memory/globalinfo.go
diff --git a/go/src/infra/gae/libs/wrapper/memory/globalinfo.go b/go/src/infra/gae/libs/wrapper/memory/globalinfo.go
deleted file mode 100644
index 397e9def6820e15582ff895a313e3b2004469e06..0000000000000000000000000000000000000000
--- a/go/src/infra/gae/libs/wrapper/memory/globalinfo.go
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2015 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.
-
-package memory
-
-import (
- "infra/gae/libs/wrapper"
-
- "golang.org/x/net/context"
-)
-
-type giContextKeyType int
-
-var giContextKey giContextKeyType
-
-func curGID(c context.Context) *globalInfoData {
- return c.Value(giContextKey).(*globalInfoData)
-}
-
-// useGI adds a wrapper.GlobalInfo context, accessible
-// by wrapper.GetGI(c)
-func useGI(c context.Context) context.Context {
- return wrapper.SetGIFactory(c, func(ic context.Context) wrapper.GlobalInfo {
- return &giImpl{wrapper.DummyGI(), curGID(ic), ic}
- })
-}
-
-type globalInfoData struct{ namespace string }
-
-type giImpl struct {
- wrapper.GlobalInfo
- data *globalInfoData
- c context.Context
-}
-
-var _ = wrapper.GlobalInfo((*giImpl)(nil))
-
-func (gi *giImpl) Namespace(ns string) (context.Context, error) {
- return context.WithValue(gi.c, giContextKey, &globalInfoData{ns}), nil
-}
« no previous file with comments | « go/src/infra/gae/libs/wrapper/memory/gkvlite_utils_test.go ('k') | go/src/infra/gae/libs/wrapper/memory/internal/goon/goon.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698