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

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

Issue 1154213012: Add context-aware "time" library wrapper. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Added coverage files. Created 5 years, 7 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 | « go/src/infra/gae/libs/wrapper/memory/context.go ('k') | go/src/infra/gae/libs/wrapper/memory/memcache.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/src/infra/gae/libs/wrapper/memory/datastore_data.go
diff --git a/go/src/infra/gae/libs/wrapper/memory/datastore_data.go b/go/src/infra/gae/libs/wrapper/memory/datastore_data.go
index 7ff288cdae84816d13ddef3e890a4a31cafabd26..d36d52ab622c09dc1e2e64da884739f1e3252460 100644
--- a/go/src/infra/gae/libs/wrapper/memory/datastore_data.go
+++ b/go/src/infra/gae/libs/wrapper/memory/datastore_data.go
@@ -8,7 +8,6 @@ import (
"errors"
"infra/gae/libs/wrapper"
goon_internal "infra/gae/libs/wrapper/memory/internal/goon"
- "math/rand"
"sync"
"sync/atomic"
@@ -16,6 +15,7 @@ import (
"appengine/datastore"
pb "appengine_internal/datastore"
+ "golang.org/x/net/context"
)
////////////////////////////////// knrKeeper ///////////////////////////////////
@@ -307,7 +307,7 @@ func (d *dataStoreData) canApplyTxn(obj memContextObj) bool {
return true
}
-func (d *dataStoreData) applyTxn(r *rand.Rand, obj memContextObj) {
+func (d *dataStoreData) applyTxn(c context.Context, obj memContextObj) {
txn := obj.(*txnDataStoreData)
for _, muts := range txn.muts {
if len(muts) == 0 { // read-only
@@ -384,7 +384,7 @@ func (td *txnDataStoreData) endTxn() {
}
atomic.StoreInt32(&td.closed, 1)
}
-func (*txnDataStoreData) applyTxn(*rand.Rand, memContextObj) {
+func (*txnDataStoreData) applyTxn(context.Context, memContextObj) {
panic("txnDataStoreData cannot apply transactions")
}
func (*txnDataStoreData) mkTxn(*datastore.TransactionOptions) (memContextObj, error) {
« no previous file with comments | « go/src/infra/gae/libs/wrapper/memory/context.go ('k') | go/src/infra/gae/libs/wrapper/memory/memcache.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698